<?php

namespace app\admin\validate\goods;

use think\Validate;

class Comment extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'user_id' => 'require',
        'order_id' => 'require',
        'goods_id' => 'require',
        'content' => 'require',
        'images' => 'require',
        'rating' => 'require',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'user_id.require' => '请填写用户ID',
        'order_id.require' => '请填写订单id',
        'goods_id.require' => '请填写商品id',
        'content.require' => '请填写评论内容',
        'images.require' => '请上传图片',
        'rating.require' => '请填写评分',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['user_id', 'goods_id', 'content', 'images', 'rating'],
        'edit' => [],
    ];
    
}
